package org.idea.spring.framework.tx.dao;

import org.idea.spring.framework.tx.config.MyTransaction;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @Author linhao
 * @Date created in 6:38 下午 2021/5/20
 */
@Repository
public class UserDao {

    @Resource
    private JdbcTemplate jdbcTemplate;

    @MyTransaction
    public void doInsertTest(){
        jdbcTemplate.execute("INSERT INTO `qiyu_user`.`t_user`( `username`) VALUES ( 'idea22')");
    }

}
